#include "msgqueue-drv.h"
#include "stdio.h"
#include "stdint.h"
#include "string.h"

enum AppMsg{
    MSG_USART = 0,
    MSG_EXIT,
    MSG_ENTER,
};

static void MsgUsartHandler(void)
{
    printf("USART Handler\r\n");
}

static void MsgExitHandler(void)
{
    printf("Msg Exit\r\n");
}

static void MsgEnterHandler(void)
{
    printf("Msg Enter\r\n");
}

stMsgHandle g_MsgHandleArr[] = {
    {.msg = MSG_USART, MsgUsartHandler},
    {.msg = MSG_EXIT, MsgExitHandler},
    {.msg = MSG_ENTER, MsgEnterHandler},
};

stMsgQueue g_MsgQueue;

int main(int argc, char **argv)
{
    uint8_t msg;

    while (1)
    {
        scanf("%d", &msg);
        MQ_PublishMsg(&g_MsgQueue, msg);
        MsgQueTask_Handle(&g_MsgQueue, g_MsgHandleArr, 3);
    }
}